package com.xidian.zhiancloud.service.exam.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xidian.zhiancloud.dao.exam.TrainingEvaMapper;
import com.xidian.zhiancloud.model.exam.TrainingEva;
import com.xidian.zhiancloud.service.exam.ITrainingEvaService;

/**
 * 培训评价Service业务层处理
 * 
 * @author zhouweitao
 * @date 2021-03-16
 */
@Service
public class TrainingEvaServiceImpl implements ITrainingEvaService 
{
    @Autowired
    private TrainingEvaMapper trainingEvaMapper;

    /**
     * 查询培训评价
     * 
     * @param id 培训评价ID
     * @return 培训评价
     */
    @Override
    public TrainingEva selectTrainingEvaById(Long id)
    {
        return trainingEvaMapper.selectTrainingEvaById(id);
    }

    /**
     * 查询培训评价列表
     * 
     * @param trainingEva 培训评价
     * @return 培训评价
     */
    @Override
    public Page<TrainingEva> selectTrainingEvaList(TrainingEva trainingEva)
    {
    	PageHelper.startPage(trainingEva.getPageNum()-1, trainingEva.getPageSize());
        return trainingEvaMapper.selectTrainingEvaList(trainingEva);
    }

    /**
     * 新增培训评价
     * 
     * @param trainingEva 培训评价
     * @return 结果
     */
    @Override
    public int insertTrainingEva(TrainingEva trainingEva)
    {
        return trainingEvaMapper.insertTrainingEva(trainingEva);
    }

    /**
     * 修改培训评价
     * 
     * @param trainingEva 培训评价
     * @return 结果
     */
    @Override
    public int updateTrainingEva(TrainingEva trainingEva)
    {
        return trainingEvaMapper.updateTrainingEva(trainingEva);
    }

    /**
     * 批量删除培训评价
     * 
     * @param ids 需要删除的培训评价ID
     * @return 结果
     */
    @Override
    public int deleteTrainingEvaByIds(Long[] ids)
    {
        return trainingEvaMapper.deleteTrainingEvaByIds(ids);
    }

    /**
     * 删除培训评价信息
     * 
     * @param id 培训评价ID
     * @return 结果
     */
    @Override
    public int deleteTrainingEvaById(Long id)
    {
        return trainingEvaMapper.deleteTrainingEvaById(id);
    }
}
